%%%-------------------------------------------------------------------
%%% @author mirahs(2892727493@qq.com)
%%% @doc
%%%     网络通讯连接接收监控树
%%% @end
%%%-------------------------------------------------------------------
-module(net_tcp_accepter_sup).

-behaviour(supervisor).

-export([
    start_link/0
    ,start_child/2

    ,init/1
]).

-include("common.hrl").


start_link() ->
    ?ECHO("正在启动[~w]", [?MODULE]),
    supervisor:start_link({local, ?MODULE}, ?MODULE, []).

start_child(ListenSocket, Idx) ->
    supervisor:start_child(?MODULE, [ListenSocket, Idx]).


init([]) ->
    ?ECHO("完成启动[~w]", [?MODULE]),
    Child = {net_tcp_accepter_srv, {net_tcp_accepter_srv, start_link, []}, transient, 2000, worker, [net_tcp_accepter_srv]},
    {ok, {{simple_one_for_one, 10, 10}, [Child]}}.
